package com.meizi.sys.controller;

import com.meizi.sys.dto.SysUserDto;
import com.meizi.sys.service.SysUserService;
import com.meizi.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administration
 * @date 2021/8/9 - 16:14 - 星期一
 * @project lambda
 * @package com.meizi.sys.controller
 * @by GGbomd猪猪侠
 */
@RestController
@Api(tags = "用户信息")
@RequestMapping(value = "/login")
public class SysController {

    @Autowired
    private SysUserService sysUserService;

    /**
     * 用户注册
     */
    @ApiOperation(value = "用户注册")
    @RequestMapping(value = "/userRegister", method = RequestMethod.POST)
    public Result<Integer> userRegister (@RequestBody SysUserDto sysUserDto) {
        return sysUserService.userRegister(sysUserDto);
    }

    /**
     * 修改用户密码
     */
    @ApiOperation(value = "修改用户密码")
    @RequestMapping(value = "/userUpdate", method = RequestMethod.POST)
    public Result<Integer> userUpdate (@RequestBody SysUserDto sysUserDto) {
        return sysUserService.userUpdate(sysUserDto);
    }
}
